FileChooserButton: Avoid unref()ing a null model
authorDaniel Boles <dboles.src@gmail.com>
Fri, 6 Oct 2017 23:09:09 +0000 (00:09 +0100)
committerDaniel Boles <dboles.src@gmail.com>
Fri, 6 Oct 2017 23:44:24 +0000 (00:44 +0100)
gtk/gtkfilechooserbutton.c

index abc6147522883cc06a4df0e84ed73cd01cf43ece..c5b58a58b9bfc867c7988da8ae76b84d60341a45 100644 (file)
@@ -1061,7 +1061,8 @@ gtk_file_chooser_button_finalize (GObject *object)
   if (priv->current_folder_while_inactive)
     g_object_unref (priv->current_folder_while_inactive);
 
-  g_object_unref (priv->model);
+  if (priv->model)
+    g_object_unref (priv->model);
 
   gtk_widget_unparent (priv->button);
   gtk_widget_unparent (priv->combo_box);